# This is a BitKeeper generated patch for the following project: # Project Name: Linux kernel tree # This patch format is intended for GNU patch command version 2.5 or higher. # This patch includes the following deltas: # ChangeSet 1.1069.175.3+1.1069.196.6 -> 1.1069.175.4 # arch/m68k/bvme6000/rtc.c 1.6.1.1 -> 1.7.1.1 # drivers/char/mips_rtc.c 1.1.1.1 -> 1.2.1.1 # drivers/sbus/char/rtc.c 1.8.1.1 -> 1.9.1.1 # drivers/char/ds1286.c 1.8.1.1 -> 1.10.1.1 # drivers/char/rtc.c 1.13.1.1 -> 1.15.1.1 # drivers/char/ip27-rtc.c 1.5.1.1 -> 1.7.1.1 # arch/cris/drivers/pcf8563.c 1.3.1.1 -> 1.4.1.1 # drivers/hil/hp_sdc_rtc.c 1.2.1.1 -> 1.3.1.1 # mm/mremap.c 1.5.1.2 -> 1.8 # Makefile 1.190.5.1 -> 1.193.1.42 # net/irda/irnet/irnet.h 1.11.1.1 -> 1.12.1.1 # drivers/char/efirtc.c 1.5.1.2 -> 1.7.1.1 # net/ipv4/netfilter/ip_fw_compat_masq.c 1.4.1.1 -> 1.5.1.1 # arch/cris/drivers/ds1302.c 1.6.1.1 -> 1.7.1.1 # drivers/macintosh/rtc.c 1.6.1.1 -> 1.7.1.1 # drivers/acorn/char/i2c.c 1.3.1.1 -> 1.4.1.1 # arch/ppc64/kernel/rtc.c 1.2.1.1 -> 1.3.1.1 # arch/m68k/mvme16x/rtc.c 1.4.1.1 -> 1.5.1.1 # diff -Nru a/Makefile b/Makefile --- a/Makefile Thu Jan 8 16:33:45 2004 +++ b/Makefile Thu Jan 8 16:33:45 2004 @@ -93,6 +93,7 @@ CFLAGS := $(CPPFLAGS) -Wall -Wstrict-prototypes -Wno-trigraphs -O2 \ -fno-strict-aliasing -fno-common +CFLAGS += -g ifndef CONFIG_FRAME_POINTER CFLAGS += -fomit-frame-pointer endif @@ -175,7 +176,6 @@ DRIVERS-$(CONFIG_PPC32) += drivers/macintosh/macintosh.o DRIVERS-$(CONFIG_MAC) += drivers/macintosh/macintosh.o DRIVERS-$(CONFIG_ISAPNP) += drivers/pnp/pnp.o -DRIVERS-$(CONFIG_SGI_IP22) += drivers/sgi/sgi.a DRIVERS-$(CONFIG_VT) += drivers/video/video.o DRIVERS-$(CONFIG_PARIDE) += drivers/block/paride/paride.a DRIVERS-$(CONFIG_HAMRADIO) += drivers/net/hamradio/hamradio.o @@ -221,6 +221,7 @@ drivers/scsi/aic7xxx/aicasm/aicdb.h \ drivers/scsi/aic7xxx/aicasm/y.tab.h \ drivers/scsi/53c700_d.h \ + drivers/tc/lk201-map.c \ net/khttpd/make_times_h \ net/khttpd/times.h \ submenu* @@ -306,8 +307,7 @@ $(CONFIG_SHELL) scripts/Configure -d arch/$(ARCH)/config.in xconfig: symlinks - $(MAKE) -C scripts kconfig.tk - wish -f scripts/kconfig.tk + @echo -e "***\n* Sorry, xconfig is broken; use \"make menuconfig\" instead.\n***" menuconfig: include/linux/version.h symlinks $(MAKE) -C scripts/lxdialog all diff -Nru a/drivers/char/ds1286.c b/drivers/char/ds1286.c --- a/drivers/char/ds1286.c Thu Jan 8 16:33:45 2004 +++ b/drivers/char/ds1286.c Thu Jan 8 16:33:45 2004 @@ -422,7 +422,7 @@ rtc_tm->tm_sec = CMOS_READ(RTC_SECONDS); rtc_tm->tm_min = CMOS_READ(RTC_MINUTES); - rtc_tm->tm_hour = CMOS_READ(RTC_HOURS) & 0x1f; + rtc_tm->tm_hour = CMOS_READ(RTC_HOURS) & 0x3f; rtc_tm->tm_mday = CMOS_READ(RTC_DATE); rtc_tm->tm_mon = CMOS_READ(RTC_MONTH) & 0x1f; rtc_tm->tm_year = CMOS_READ(RTC_YEAR); diff -Nru a/drivers/char/ip27-rtc.c b/drivers/char/ip27-rtc.c --- a/drivers/char/ip27-rtc.c Thu Jan 8 16:33:45 2004 +++ b/drivers/char/ip27-rtc.c Thu Jan 8 16:33:45 2004 @@ -226,8 +226,8 @@ return -ENOENT; } - rtc_freq = 1024; + return 0; } diff -Nru a/drivers/char/rtc.c b/drivers/char/rtc.c --- a/drivers/char/rtc.c Thu Jan 8 16:33:45 2004 +++ b/drivers/char/rtc.c Thu Jan 8 16:33:45 2004 @@ -35,17 +35,16 @@ * 1.09a Pete Zaitcev: Sun SPARC * 1.09b Jeff Garzik: Modularize, init cleanup * 1.09c Jeff Garzik: SMP cleanup - * 1.10 Paul Barton-Davis: add support for async I/O + * 1.10 Paul Barton-Davis: add support for async I/O * 1.10a Andrea Arcangeli: Alpha updates * 1.10b Andrew Morton: SMP lock fix * 1.10c Cesar Barros: SMP locking fixes and cleanup * 1.10d Paul Gortmaker: delete paranoia check in rtc_exit * 1.10e Maciej W. Rozycki: Handle DECstation's year weirdness. + * 1.10f Maciej W. Rozycki: Handle memory-mapped chips properly. */ -#define RTC_VERSION "1.10e" - -#define RTC_IO_EXTENT 0x10 /* Only really two ports, but... */ +#define RTC_VERSION "1.10f" /* * Note that *all* calls to CMOS_READ and CMOS_WRITE are done with @@ -84,7 +83,9 @@ static int rtc_irq = PCI_IRQ_NONE; #endif +#if RTC_IRQ static int rtc_has_irq = 1; +#endif /* * We sponge a minor off of the misc major. No need slurping @@ -97,7 +98,9 @@ static DECLARE_WAIT_QUEUE_HEAD(rtc_wait); +#if RTC_IRQ static struct timer_list rtc_irq_timer; +#endif static ssize_t rtc_read(struct file *file, char *buf, size_t count, loff_t *ppos); @@ -238,7 +241,15 @@ if (rtc_has_irq == 0) return -EIO; - if (count < sizeof(unsigned long)) + /* + * Historically this function used to assume that sizeof(unsigned long) + * is the same in userspace and kernelspace. This lead to problems + * for configurations with multiple ABIs such a the MIPS o32 and 64 + * ABIs supported on the same kernel. So now we support read of both + * 4 and 8 bytes and assume that's the sizeof(unsigned long) in the + * userspace ABI. + */ + if (count != sizeof(unsigned int) && count != sizeof(unsigned long)) return -EINVAL; add_wait_queue(&rtc_wait, &wait); @@ -268,9 +279,12 @@ schedule(); } while (1); - retval = put_user(data, (unsigned long *)buf); + if (count == sizeof(unsigned int)) + retval = put_user(data, (unsigned int *)buf); + else + retval = put_user(data, (unsigned long *)buf); if (!retval) - retval = sizeof(unsigned long); + retval = count; out: current->state = TASK_RUNNING; remove_wait_queue(&rtc_wait, &wait); @@ -707,6 +721,9 @@ struct isa_device *isa_dev; #endif #endif +#ifndef __sparc__ + void *r; +#endif #ifdef __sparc__ for_each_ebus(ebus) { @@ -753,18 +770,24 @@ } no_irq: #else - if (!request_region(RTC_PORT(0), RTC_IO_EXTENT, "rtc")) - { - printk(KERN_ERR "rtc: I/O port %d is not free.\n", RTC_PORT (0)); + if (RTC_IOMAPPED) + r = request_region(RTC_PORT(0), RTC_IO_EXTENT, "rtc"); + else + r = request_mem_region(RTC_PORT(0), RTC_IO_EXTENT, "rtc"); + if (!r) { + printk(KERN_ERR "rtc: I/O resource %lx is not free.\n", + (long)(RTC_PORT(0))); return -EIO; } #if RTC_IRQ - if(request_irq(RTC_IRQ, rtc_interrupt, SA_INTERRUPT, "rtc", NULL)) - { + if(request_irq(RTC_IRQ, rtc_interrupt, SA_INTERRUPT, "rtc", NULL)) { /* Yeah right, seeing as irq 8 doesn't even hit the bus. */ printk(KERN_ERR "rtc: IRQ %d is not free.\n", RTC_IRQ); - release_region(RTC_PORT(0), RTC_IO_EXTENT); + if (RTC_IOMAPPED) + release_region(RTC_PORT(0), RTC_IO_EXTENT); + else + release_mem_region(RTC_PORT(0), RTC_IO_EXTENT); return -EIO; } #endif @@ -848,7 +871,10 @@ if (rtc_has_irq) free_irq (rtc_irq, &rtc_port); #else - release_region (RTC_PORT (0), RTC_IO_EXTENT); + if (RTC_IOMAPPED) + release_region(RTC_PORT(0), RTC_IO_EXTENT); + else + release_mem_region(RTC_PORT(0), RTC_IO_EXTENT); #if RTC_IRQ if (rtc_has_irq) free_irq (RTC_IRQ, NULL); diff -Nru a/mm/mremap.c b/mm/mremap.c --- a/mm/mremap.c Thu Jan 8 16:33:45 2004 +++ b/mm/mremap.c Thu Jan 8 16:33:45 2004 @@ -9,6 +9,7 @@ #include #include #include +#include #include #include @@ -279,6 +280,10 @@ vma = find_vma(current->mm, addr); if (!vma || vma->vm_start > addr) goto out; + if (is_vm_hugetlb_page(vma)) { + ret = -EINVAL; + goto out; + } /* We can't remap across vm area boundaries */ if (old_len > vma->vm_end - addr) goto out;